<?php
/**
 *    view module: my_favorites
 *    File: modules/my_favorites.php
 */
?>

            <h4 class="favorites"><?php echo lang('my_favorites'); ?></h4>
            <div class="profil-favorite">
              
            <?php
            // Get favorites from library
            $favorites = $this->modules->getFavorites();
            
            if( count($favorites)>0 )
            {
              $i=0;
              foreach( $favorites as $row )
              {
                if( $row->image_name != NULL )            
                  $image = "<img src='".base_url()."profile/image/thumb/{$row->favorite_id}/{$row->image_name}' alt='{$row->username}'>";            
                else
                  $image = "<img src='".base_url()."img/no_photo.gif' alt=''>";
                $name = ( $row->name != "" )?$row->name:$row->username;
                
                echo "<a href='".base_url()."profile/view-profile/{$row->username}.htm' >{$image}</a>\n\n";
                
                $i++;
                if( $i>8 ) break; // Samo 8 linkova u box-u
              }
            }
                
            ?>
                          	
            </div><!--end profil-favorite-->
            <a href="<?php echo base_url(); ?>favorites.htm" title=""><?php echo lang('full_list_favorites'); ?></a>